/**
 * Copyright (c) 2006 Amgad S Youssef
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipsejcde.core.jcdk;

import java.io.File;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipsejcde.core.JCDECore;

/**
 * @author Amgad S Youssef
 *
 */
public class JCDKClasspathContainer implements IClasspathContainer {
	@Override
	public IClasspathEntry[] getClasspathEntries() {
		IClasspathEntry[] classpathEntries = new IClasspathEntry[1];
		classpathEntries[0] = JavaCore.newLibraryEntry(new Path(new File(JCDECore.getCurrentJCDKHome() + "/lib/api.jar").getAbsolutePath()), null, null);
		return classpathEntries;
	}

	@Override
	public String getDescription() {
		return JCDECore.getCurrentJCDKVersion();
	}

	@Override
	public int getKind() {
		return K_SYSTEM;
	}

	@Override
	public IPath getPath() {
		return new Path(JCDECore.JCDK_CONTAINER_PATH);
	}

}
